package org.example.creational.singleton.lazy;

public class StaticInnerClassSingleton {
    private static class InnerClass{
        //非构造线程无法看到对象初始化的重排序，类初始化时候会被jvm加初始化锁，（Class被加载后，线程使用之前会）
        private static StaticInnerClassSingleton staticInnerClassSingleton = new StaticInnerClassSingleton();
    }
    public static StaticInnerClassSingleton getInstance() {
        return InnerClass.staticInnerClassSingleton;
    }
    
    private StaticInnerClassSingleton() {

    }
}
